package com.digitalchina.lxnsy.viewholder;

import android.view.ViewGroup;
import android.widget.TextView;

import com.digitalchina.lxnsy.R;
import com.digitalchina.lxnsy.entity.GoodsVO;
import com.digitalchina.lxnsy.toolkit.FrescoUtil;
import com.facebook.drawee.view.SimpleDraweeView;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.viewholder
 * 创建人：郑皓
 * 创建时间：2017/1/11 17:00
 * 修改备注：
 * ================================================
 */
public class GoodsAllHolder extends BaseViewHolder<GoodsVO> {

    private SimpleDraweeView itemGoodsAllSdv;
    private TextView itemGoodsAllTvTitle;
    private TextView itemGoodsAllTvIntro;
    private TextView itemGoodsAllTvRmbPrice;
    private TextView itemGoodsAllTvType;

    public GoodsAllHolder(ViewGroup parent) {
        super(parent, R.layout.item_merchant_goods_all);
        itemGoodsAllSdv = $(R.id.item_goods_all_sdv);
        itemGoodsAllTvTitle = $(R.id.item_goods_all_tv_title);
        itemGoodsAllTvIntro = $(R.id.item_goods_all_tv_intro);
        itemGoodsAllTvRmbPrice = $(R.id.item_goods_all_tv_rmb_price);
        itemGoodsAllTvType = $(R.id.item_goods_all_tv_type);
    }

    @Override
    public void setData(GoodsVO data) {
        super.setData(data);

        FrescoUtil.showImageSmall(data.getImages() != null ? data.getImages() : "", itemGoodsAllSdv);
        itemGoodsAllTvIntro.setText(data.getIntroduce() != null ? data.getIntroduce() : "");
        itemGoodsAllTvTitle.setText(data.getTitle() != null ? data.getTitle() : "");
        itemGoodsAllTvRmbPrice.setText(data.getAmount_num() != null ? data.getAmount_num() : "");
        itemGoodsAllTvType.setText(data.getResourceType() != null ? data.getResourceType() : "");


    }
}
